type EventNames = 'click' | 'scroll' | 'mousemove'
function handleEvent(ele: Element, event: EventNames) {
  // do something
}

handleEvent(document.getElementById('hello') as Element, 'scroll') // 没问题
handleEvent(document.getElementById('world') as Element, 'dblclick') // 报错，event 不能为 'dblclick'
